<?php
include('general_include.php');

$userid = @$_SESSION['user_id'];
$_SESSION['user_id'] = "";
unset($_SESSION['user_id']);
unset($_SESSION['name']);
unset($_SESSION['user_type']);

$updateUserStatusSql = "UPDATE ".TABLEPREFIX."_user SET is_logged_in = 0 WHERE user_id = '".$userid."'";
$UserManagerObjAjax->Execute($updateUserStatusSql);

$updateUserStatusSql = "DELETE FROM frei_session where session_id = '".$userid."'";
$UserManagerObjAjax->Execute($updateUserStatusSql);

echo "<script>parent.window.location.href='index.php'</script>";

exit;
?>